# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=deepin-image-editor
pkgver=1.0.38
pkgrel=1
pkgdesc='Public library for deepin-image-viewer and deepin-album'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/image-editor"
license=('GPL3')
depends=('dtkcore' 'dtkgui' 'dtkwidget' 'qt5-base' 'qt5-svg' 'libtiff' 'ffmpegthumbnailer'
         'freeimage' 'libmediainfo' 'opencv' 'gcc-libs' 'deepin-util-dfm')
makedepends=('cmake' 'ninja' 'qt5-tools')
source=("https://github.com/linuxdeepin/image-editor/archive/$pkgver/$pkgname-$pkgver.tar.gz"
        remove-broken-flags.patch)
sha512sums=('3fba144b2f2cd2758b0e8722943e513d22e158527a568203086418195d4345fc218de92c86be18bbde4d9f6dd9bce0e0111c8b3bcf786529b6c9a66848b8e8d2'
            'bc72e7732ae045a10129336a770d04827c487fb57938c4711e57aeeccde369fca207913477a695cddffc7d0fb6d77add1f75b9b5ca784d0285b8f4f56c2376ad')

prepare() {
  patch -d image-editor-$pkgver -p2 < remove-broken-flags.patch
}

build() {
  cd image-editor-$pkgver
  cmake . -GNinja -DCMAKE_INSTALL_PREFIX=/usr
  ninja
}

package() {
  cd image-editor-$pkgver
  DESTDIR="$pkgdir" ninja install
}
